package edu.fim.core.starter;

import java.util.logging.Logger;

import javax.swing.JOptionPane;
import javax.swing.UIManager;

import edu.fim.core.service.FIMService;
import edu.fim.core.service.locator.ServiceLocator;

public class FIMStarter {

	private final static Logger LOGGER = Logger.getLogger(FIMStarter.class.getName());

	public static void main(String[] args) {
		setLookAndFeel();
		initialize();
	}

	private static void initialize() {
		FIMService service = ServiceLocator.getImplementation(FIMService.class);
		service.initialize();
	}

	private static void setLookAndFeel() {
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (Exception e) {
			JOptionPane.showMessageDialog(null, "There was an error while launching the application.");
			LOGGER.severe("Error while setting look and feel.");
		}
	}
}